package com.atguigu.yygh.cmn.demo;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.ArrayList;
import java.util.Map;

/**
 * @Author luoyin
 * @Date 19:28 2022/9/23
 **/
public class ExcelListener extends AnalysisEventListener<Student> {

    ArrayList<Student> list = new ArrayList<>();

    @Override
    public void invoke(Student student, AnalysisContext analysisContext) {
        list.add(student);
        System.out.println("student = " + student);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("headMap = " + headMap);
    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
        System.out.println("list = " + list);
    }
}
